package L07.T01;

import java.util.List;
import java.util.Scanner;

public class Test {

    public static void main (String[] args) {
        Scanner in=new Scanner (System.in);
        //hasNextline()方法检查下一行是否有字符串可以读入
        while(in.hasNextLine ()){
            String str=in.nextLine ();


        }
    }
    public static void main2 (String[] args) {
        BinaryTree tree=new BinaryTree ();
        BinaryTree.TreeNode ret=tree.creatTree ();

        boolean isFind=tree.findNode (ret,'E');
        System.out.println (isFind);
    }
    public static void main1 (String[] args) {
        BinaryTree tree=new BinaryTree ();
        BinaryTree.TreeNode ret=tree.creatTree ();
        System.out.println ("===========");
        tree.preOrder (ret);
        System.out.println ("===========");
        List<BinaryTree.TreeNode> Ret=tree.preOrder2(ret);
        for (BinaryTree.TreeNode x:Ret) {
            System.out.print (x.val+" ");
        }

        System.out.println ();
        tree.nodeSize (ret);
        System.out.println ("结点的个数："+tree.size);

        System.out.println ();
        tree.leafSize (ret);
        System.out.println ("叶子结点的个数"+tree.leafSize);

        System.out.println ("第3层的节点数："+tree.layerSize (ret,3));

        System.out.println ("树的高度是："+tree.getHeight (ret));
    }
}
